package com.devunion.salon.persistence;

import javax.persistence.*;

/**
 *
 CREATE TABLE `service` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(50) NOT NULL,
   `category_id` int(11) NOT NULL default '0',
   PRIMARY KEY  (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
 *
 * @author Viktar Liaskovich
 */
@Entity
@Table(name = "service")
public class Service extends BasePersistentObject{

    @Column(name = "name", length = 50, nullable = false)
    private String name;

    @Column(name = "price", nullable = true)
    private Float price;

    @ManyToOne(cascade = {CascadeType.REMOVE})
    private Location location;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }
}
